package cate.common.table.item.hero.sheet;

import cate.common.table.ESheet;
import cate.common.table.item.hero.row.HeroBaseRow;
import easy.java.dev.note.NoteClass;

@NoteClass("英雄基础表")
public class HeroBaseSheet extends ESheet<HeroBaseRow> {

    @Override
    public String getSheetName() {
        return "基础";
    }

    public HeroBaseRow getRow(int protoId, int star) {
        for (HeroBaseRow row : this.getList()) {
            if (row.protoId == protoId && row.star == star) {
                return row;
            }
        }
        return null;
    }
    /** 英雄id 获取这个英雄原型能升的最大等级限制， */
    public int checkMaxStarLvlLimite(int protoId) {
        int max = 0;
        for (HeroBaseRow row : this.getList()) {
            if (row.protoId == protoId && row.levelMax > max) {
                max = row.levelMax;
            }
        }
        return max;
    }
}
